/*
	Copyright 2012 J. Gohlke
	Licensed under the Apache License, Version 2.0 (the
	"License"); you may not use this file except in
	compliance with the License. You may obtain a copy
	of the License at

	http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in
	writing, software distributed under the License is
	distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or
	implied. See the License for the specific language
	governing permissions and limitations under the
	License
 */
package com.gohlke.lwo.textures;

/**
 *
 * @author David
 */
public enum ReflectionOptions {
    /*
     * Only the backdrop is reflected.
     */
    BackdropOnly (0),
    /*
     * Objects in the scene are reflected when raytracing is enabled. 
     * Rays that don't intercept an object are assigned the backdrop color.
     */
    RaytracingAndBackdrop (1),
    /*
     * If an image is provided in an RIMG subchunk, the image is 
     * reflected as if it were spherically wrapped around the scene.
     */
    SphericalMap (2),
    /*
     * Objects in the scene are reflected when raytracing is enabled. 
     * Rays that don't intercept an object are assigned a color from the image map.
     */
    RaytracingAndSphericalMap (3);
    
    private final int index;
    
    ReflectionOptions(int index) { this.index = index; }
    
    public int index() { return this.index; }
    
    public static ReflectionOptions from(int index) {
        for (ReflectionOptions g : ReflectionOptions.values())
            if (g.index == index)
                return g;
        return null;
    }
    
}
